package com.wjm.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import com.wjm.util.PropertiesUtil;
import com.wjm.util.StringUtil;

public class MachineClientInterceptor extends HandlerInterceptorAdapter {

	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		HttpSession session = request.getSession();
		if (session.getAttribute(StringUtil.WEB_ROOT_KEY_SESS) == null) {
			session.setAttribute(StringUtil.WEB_ROOT_KEY_SESS, PropertiesUtil.getValue(StringUtil.WEB_ROOT_KEY));
		}
		return true;
	}
	
}
